const minify = require('html-minifier').minify;

module.exports = source => {
  const html = minify(source.replace(/\d+(\.\d+)?pt/gi, pt => {
    return `${((Number.parseInt(pt, 10) / 12) * 0.7).toFixed(2)}em`
  }), {
    removeComments: true,
    collapseWhitespace: true,
    minifyJS: true,
    minifyCSS: true
  });
  return `export default ${JSON.stringify(html)}`;
} 